#include <stdio.h>
#include <string.h>

void int_to_array(int num, int arr[], int *len)
{
    *len = 0; // 初始化数组长度为0
    if (num == 0)
    {
        arr[0] = 0;
        *len = 1;
        return;
    }

    // 处理负数，将其转换为正数
    if (num < 0)
    {
        num = -num;
    }

    // 逐位取出数字并存入数组
    while (num > 0)
    {
        arr[*len] = num % 10;
        num /= 10;
        (*len)++;
    }
}

int main()
{
    int num;
    int arr[10];
    int len;

    scanf("%d", &num);

    int_to_array(num, arr, &len);

    printf("整数的各位数为：");
    for (int i = len - 1; i >= 0; i--)
    {
        printf("%d ", arr[i]);
    }
    printf("\n");

    return 0;
}
